#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn=50010;
int f[maxn],p[maxn],ans[maxn],n;
vector<int> son[maxn];
int min(int x,int y){return x<y?x:y;}
int max(int x,int y){return x>y?x:y;}
void dfs(int root)
{
	if(son[root].size()==0)
	{
		f[root]=1;return;
	}
	for(int i=0;i<son[root].size();i++)
	{
		dfs(son[root][i]);
		f[root]+=f[son[root][i]];
	}
	f[root]++;
}
int main()
{
	scanf("%d",&n);
	memset(p,0,sizeof(p));
	memset(f,0,sizeof(f));
	for(int i=1;i<n;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		if(p[x]==0)
		{
			p[x]=y;
			son[y].push_back(x);
		}
		else
		{
			p[y]=x;
			son[x].push_back(y);
		}
	}
	int root=0,c=1;
	for(int i=1;i<=n;i++)
		if(p[i]==0){root=i;break;}
	dfs(root);
	for(int i=1;i<=n;i++)
	{
		if(i!=root)ans[i]=f[root]-f[i];
		else ans[i]=0;
		for(int j=0;j<son[i].size();j++)
			ans[i]=max(ans[i],f[son[i][j]]);
	}
	for(int i=1;i<=n;i++)
		if(ans[i]<=n/2)
			cout<<i<<endl;
	return 0;
}

